<include file="Public:header" />
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title"  class="col-md-6">
            <h5>买单列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->
            <form id='commentForm' role="form" method="get" class="form-inline">
                <div class="content clearfix m-b">
                    <div class="form-group">
                        <label>用户名：</label>
                        <input type="text" class="form-control" id="username" name="username" value="{$Think.get.username}">
                    </div>
                    <div class="form-group">
                        <button class="btn btn-primary" type="submit" style="margin-top:5px" id="search"><strong>搜 索</strong>
                        </button>
                    </div>
                </div>
            </form>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>
				<div class="example-wrap">
					<div class="example">
						<div class="bootstrap-table">
							<div class="fixed-table-container" style="height: 641px; padding-bottom: 36px;">
								<div class="fixed-table-header" style="margin-right: 0px;"></div>
								<div class="fixed-table-body">
									<table id="cusTable" data-height="700" class="table table-hover table-striped">
										<thead>
											<th tabindex="0">
												<div class="th-inner ">序号</div>
											</th>
											<th tabindex="0">
												<div class="th-inner ">用户</div>
											</th>
											<th tabindex="0">
												<div class="th-inner ">价格</div>
											</th>
											<th tabindex="0">
												<div class="th-inner ">数量</div>
											</th>
											<th tabindex="0">
												<div class="th-inner ">日期</div>
											</th>
											<th tabindex="0">
												<div class="th-inner ">操作</div>
											</th>
										</thead>
										<tbody>
											<volist name="list['content']" id="vo" key="key">
											<tr class="list_row2">
												<td class="details" style="padding-left:10px;">{$key}</td>
												<td class="details" style="padding-left:10px;">{$vo['user']['username']}</td>
												<td class="details" align="center" style="padding-left:10px;">{$vo['price']}</td>
												<td class="details" align="center" style="padding-left:10px;">{$vo['num']}</td>
												<td class="details" align="center" style="padding-left:10px;">{$vo['add_time']|getDateFormat}</td>
												<td class="details" align="center" style="padding-left:10px;"></td>
											</tr>
											</volist>
											<tr><td colspan="13">{$list['page']}</td>
											</tr>
										</tbody>
									</table>
								</div>
								<div class="pull-right pagination"></div>
							</div>
						</div>
						<div class="clearfix"></div>
					</div>
				</div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>
<include file="Public:footer" />
<script type="text/javascript">
				function Revoke(id){
				layer.confirm('是否撤销挂单？', {
				  btn: ['确认','取消'] //按钮
				}, function(){
					$.ajax({
						 type: "POST",
						 url: "{:U('Sell/revokeSell')}",
						 data: {'id':id},
						 dataType: "json",
						 error: function(request) {
							layer.closeAll('loading');
							layer.alert("{$Think.lang.系统繁忙请稍后再试}");
						},
						beforeSend: function() {
							var index = layer.load(1, {
							  shade: [0.1,'#fff'] 
							});
						},
						 success: function(data){
								layer.closeAll('loading');
								layer.alert(data['info']);
								if(data['status']==true){
									setTimeout(history.go(0),1000);
								}
							}
					});
				});
			};
				function sureSell(id){
				layer.confirm('确认收款后您的订单将成交', {
				  btn: ['确认','取消'] //按钮
				}, function(){
					$.ajax({
						 type: "POST",
						 url: "{:U('Sell/sureSellSub')}",
						 data: {'id':id},
						 dataType: "json",
						 error: function(request) {
							layer.closeAll('loading');
							layer.alert("{$Think.lang.系统繁忙请稍后再试}");
						},
						beforeSend: function() {
							var index = layer.load(1, {
							  shade: [0.1,'#fff'] 
							});
						},
						 success: function(data){
								layer.closeAll('loading');
								layer.alert(data['info']);
								if(data['status']==true){
									setTimeout(history.go(0),1000);
								}
							}
					});
				});
			};
				function giveup(id){
				layer.confirm('是否放弃此条挂单？', {
				  btn: ['确认','取消'] //按钮
				}, function(){
					$.ajax({
						 type: "POST",
						 url: "{:U('Sell/giveUpBuySub')}",
						 data: {'id':id},
						 dataType: "json",
						 error: function(request) {
							layer.closeAll('loading');
							layer.alert("{$Think.lang.系统繁忙请稍后再试}");
						},
						beforeSend: function() {
							var index = layer.load(1, {
							  shade: [0.1,'#fff'] 
							});
						},
						 success: function(data){
								layer.closeAll('loading');
								layer.alert(data['info']);
								if(data['status']==true){
									setTimeout(history.go(0),1000);
								}
							}
					});
				});
			};
				function pay(id){
				layer.confirm('确认此条挂单已经付款？', {
				  btn: ['确认','取消'] //按钮
				}, function(){
					$.ajax({
						 type: "POST",
						 url: "{:U('Sell/paySellSub')}",
						 data: {'id':id},
						 dataType: "json",
						 error: function(request) {
							layer.closeAll('loading');
							layer.alert("{$Think.lang.系统繁忙请稍后再试}");
						},
						beforeSend: function() {
							var index = layer.load(1, {
							  shade: [0.1,'#fff'] 
							});
						},
						 success: function(data){
								layer.closeAll('loading');
								layer.alert(data['info']);
								if(data['status']==true){
									setTimeout(history.go(0),1000);
								}
							}
					});
				});
			};
</script>
</body>
</html>